import React,{Component} from 'react';
import {
    View,
    Text,
    StyleSheet,

} from 'react-native';
import HomeImportantFollow from '../home-index/HomeImportantFollow';//格局战
import HomeOperateIndex from '../home-index/HomeOperateIndex';//指标
import Style from '../../../../components/Style';
import Tool from '../../../../components/Tool';
const {
    color,fontSize
} = Style;

export default class Relation extends Component{
    constructor(props){
        super(props);
        this.state={
            choose:'import',
        }
    }

    _change(value){
        let _this = this;
        _this.setState({
            choose:value,
        });
    }
    render(){
        return(
            <View >
                <View style={styles.titleView}>
                    <View style={[styles.titleNextView,{paddingLeft:30}]}>
                        <Text style={[styles.titText,this.state.choose=='import'?styles.titActive:null]}
                                                             onPress={()=>this._change('import')}>格局战</Text>
                    </View>
                    <View style={[styles.titleNextView,{paddingRight:30}]}>
                        <Text style={[styles.titText,this.state.choose=='kpi'?styles.titActive:null]}
                                                             onPress={()=>this._change('kpi')}>经营指标</Text></View>
                </View>
                <View>
                    {
                        this.state.choose == 'import'?<HomeImportantFollow/>:<HomeOperateIndex/>
                    }
                </View>
            </View>
        )
    }
}
const styles = StyleSheet.create({
    titleView : {
        flexDirection:'row',
        marginTop:10,marginBottom:5
    },
    titleNextView:{
        flex:1,
        alignItems:'center',
    },
    titText:{
        fontSize:16,
        color:color.black,
        paddingBottom:5,
        textAlign:'center',
        width:80,
        fontWeight:'bold'
    },
    titActive:{
        borderBottomColor:color.blue,
        borderBottomWidth:2,
        borderStyle:'dotted',
    }
});